package com.maidshop.maid.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.maidshop.maid.domain.Maid;
import com.maidshop.maid.domain.dto.MaidDto;
import com.maidshop.maid.domain.vo.MaidVo;
import com.maidshop.maid.mapper.MaidMapper;
import com.maidshop.maid.service.MaidService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 22384
* @description 针对表【a_maid(女仆表)】的数据库操作Service实现
* @createDate 2025-01-20 15:34:23
*/
@Service
@Transactional(readOnly = true)
public class MaidServiceImpl extends ServiceImpl<MaidMapper, Maid>
    implements MaidService {

    @Resource
    private MaidMapper maidMapper;

    @Transactional(readOnly = false)
    @Override
    public void saveMaid(Maid maid) {
        // 保存女仆信息
        maidMapper.saveMaid(maid);
    }

    @Override
    public int deleteMaid(Long maidId) {
        return maidMapper.deleteMaid(maidId);
    }

    @Override
    public int updateMaid(Maid maid) {
        return maidMapper.updateMaid(maid);
    }

    @Override
    public MaidDto getMaidById(Long maidId) {
        return maidMapper.getMaidById(maidId);
    }

    @Override
    public List<MaidDto> list(MaidVo maidVo) {
        return maidMapper.list(maidVo);
    }
}




